<template>

  <el-dialog
    :title="dialogTitle"
    :visible.sync="dialogVisible"
    width="30%"
  >
    <el-button type="primary" @click="submitForm">提交</el-button>
    <el-button @click="closeDialog">取消</el-button>
  </el-dialog>

</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false,
      dialogMode: 'add',

    };
  },
  computed: {
    dialogTitle() {
      return this.dialogMode === 'add' ? '新增用户' : '编辑用户';
    },
  },
  methods: {
    submitForm() {
      this.closeDialog();
    },
    closeDialog() {
      this.dialogVisible = false;
      this.emp = {};
    },
  },
  watch: {
  },
};
</script>
